Main.Preloader = function (game) 
{
    this.game = game;
};

Main.Preloader.prototype = {
    loaderFull:Phaser.Sprite,
    preload: function () 
    {
	    this.loaderFull = this.add.sprite(120, 450, 'preloaderBar');
        this.loaderFull.scale.x = 0.0;
        
        this.game.load.image('startmenu', 'images/startmenu.png');
        this.game.load.image('deadscreen', 'images/deadscreen.png');

        this.game.load.image('sky', 'images/sky.png');
		this.game.load.image('ground', 'images/platform.png');
		this.game.load.image('fondo', 'images/city_2.png');
		this.game.load.image('fondo2', 'images/city_5.png');
		this.game.load.image('medidor', 'images/medidor_v2.png');
		this.game.load.image('diamond', 'images/diamond.png');
		

		this.game.load.spritesheet('dude', 'images/flash_running_v2.png', 100, 100);
		this.game.load.spritesheet('bomb', 'images/bomb.png', 36, 36);
        
      
        
        this.load.onFileComplete.add(this.fileLoaded, this);
    },
    create: function () 
    {        
        this.game.state.start('StartMenu');
    },
    fileLoaded: function (progress) 
    {
       this.loaderFull.scale.x = progress / 100;
    }
};
